/**
 * 
import React from 'react';
import {BrowserRouter as Router,Route,Switch,Redirect} from 'react-router-dom';
import { connect } from 'react-redux'
import Routers from './router/routerMap'

// 公共头部组件
import Header from './common/header'
// 404页面
import NotFound from './containers/notFound'

 
class App extends React.Component {
   constructor(props) {
     super(props)
   }
   render() {
     let token = this.props.token
     return (
       <Router>
         <div>
           <Header />
           <Switch>
             {Routers.map((item, index) => {
               return <Route key={index} path={item.path} exact render={props =>
                 (!item.auth ? (<item.component {...props} />) : (token ? <item.component {...props} /> : <Redirect to={{
                   pathname: '/login',
                   state: { from: props.location }
                 }} />)
                 )} />
             })}
             // 所有错误路由跳转页面
             <Route component={NotFound} />
           </Switch>
         </div>
       </Router>
     )
   }
 }
 
 // redux拿到token并挂载到App的props上面
 const mapStateToProps = (state, ownProps) => {
   return { token: state.token }
 }
 
 export default connect(mapStateToProps)(App)
 * 
 * 
 */